package com.lzy.web.facade.mq;

import org.springframework.amqp.core.AmqpTemplate;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

/**
 * Created with IntelliJ IDEA.
 * Description:
 * User: ellengou
 * Date: 2017-12-12
 * Time: PM 2:10
 */
@Service
public class RabbitmqProducerService {

    @Autowired(required = false)
    private AmqpTemplate amqpTemplate;

    public void sendQueue(String exchange_key, String queue_key, Object object) {
        amqpTemplate.convertAndSend(exchange_key, queue_key, object);
        System.out.println("发送时间 :  " + System.nanoTime());
    }

}
